package com.zbkj.crmeb.enums;

import com.baomidou.mybatisplus.core.enums.IEnum;
import com.fasterxml.jackson.annotation.JsonValue;

/**
 * 资金类型
 * @Description:
 * @author cyz
 * @date 2021-05-12
 */
public enum CommissionTypeEnum implements IEnum<Integer> {
    /**
     * 天猫
     */
    YJ_佣金(1, "佣金"),
    TX_提现(2, "提现"),
    TK_退款(3, "退款"),
    // 取消重新计算:主要针对拼团的佣金计算
    CS_取消重算(4, "取消重新计算");

    private Integer code;
    private String msg;

    public static CommissionTypeEnum valueOf(Integer code) {
        for (CommissionTypeEnum value : values()) {
            if (value.getCode() == code) {
                return value;
            }
        }

        return null;
    }

    CommissionTypeEnum(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }

    @Override
    @JsonValue
    public Integer getValue() {
        return code;
    }

}
